<div class="demo optimizeDemo" [class.activate]="isActivated">
	<span id="demo-setting" (click)="onToggle()"  [ngClass]="{active:isActivated}">
		<i class="fa fa-cog fa-question-circle"><span class="num">{{totalCount}}</span></i>
	</span>
	<form>
		<div class="recordItem" *ngIf='!isAddRecord'>
			<div style="font-size: 12px;color: #999;position: absolute;top: 40px;;">车牌：{{isGetRecord.carNumber}}</div>
			<legend class="no-padding margin-bottom-10 topContent">问题记录  <span>
				<span *ngIf="isActivated">[<span>{{totalCount}}</span>]</span>
				<a href="#/abnormal-alert/artificialMonitor" class="jumpPage">查看</a></span>
			</legend>
			
			<div class="bodyContent"> 
				<ul *ngFor='let rows of recordArr;let i=index'>
					<li class="item">
						<div>{{i+1}} ：{{rows.reason}}</div>
						<div>时间：{{rows.createDate}}</div>
					</li>
				</ul>
				
			</div>
			<div class="table-fix clearfix">
				<paginator [totalRecords]="totalCount"
			           [pageLinkSize]="2"
			           [currentPage]="curPage - 1"
			           (onPageChange)="paginate($event)">
				</paginator>
			</div>
			
			<div class="bottomContent" >
				
				<button type="button" class="btn btn-primary btn-sm" (click)='toAddRecord()' >添加</button>
				
			</div>
		</div>
		
		<div class="addRecord"   *ngIf='isAddRecord'>
			<legend class="no-padding margin-bottom-10 topContent">添加问题</legend>
			<div class="bodyContent">
				<div style="line-height: 32px;">车牌：
					<span *ngIf='isGetRecord.carNumber'>{{isGetRecord.carNumber}}</span>
					<span *ngIf='!isGetRecord.carNumber'>未选择</span>
				</div>
				<div> 
					<div>问题分类：</div>   
					<select name="sortType" class="form-control inline_block fix_padding" [(ngModel)]="sortType" (change)="sortTypeChange()" style="width: 80px;vertical-align: top;">
						<option value="">请选择</option>
						<option value="1">算法</option>
						<option value="2">硬件</option>
					</select><span style="padding: 0 2px;display: inline-block;line-height: 32px;">-</span><select name="abnormalType" 
						class="form-control inline_block fix_padding" 
						[(ngModel)]="abnormalType" 
						*ngIf="sortType === '2'" 
						(change)="abnormalTypeChange()"
						style="width: 110px;vertical-align: top;">
						<option value="">请选择</option>
						<option value="传感器">传感器</option>
						<option value="GPS">GPS</option>
						<option value="主机">主机</option>
						<option value="线材">线材</option>
					</select><select name="describe" class="form-control inline_block fix_padding" [(ngModel)]="describe" *ngIf="sortType === '1'" style="width: 110px;vertical-align: top;">
						<option value="">请选择</option>
						<option value="上货异常">上货异常</option>
						<option value="未识别上货">未识别上货</option>
						<option value="卸货异常">卸货异常</option>
						<option value="断电未归零">断电未归零</option>
						<option value="途中掉重量">途中掉重量</option>
					</select><select name="" *ngIf="!sortType" style="width: 110px;vertical-align: top;" class="form-control inline_block fix_padding">
						<option value="">请选择</option>
					</select>
					<div *ngIf="abnormalType === '传感器'">
						<div class=""  *ngFor="let item of faultItemlist;let i=index;">
							<div>异常描述{{i+1}}：</div>
							<div class="inline_block" style="padding-right: 0; width:84px;">
								<div class="clearfix" >
									<select class="form-control fix_padding"  style="width: 100%;"  [attr.data]="item.type"  (change)="selectedChange($event,'type',item)">
										<option value="">请选择</option>
										<option *ngFor="let _item of phenTypeArr;let li = index;" [value]="_item.type"> {{_item.text}}</option>
									</select>
								</div>
							</div>
							<div class="inline_block" style="width: 84px;position: relative;left: 4px;">
								<span style="position: absolute;left: -6px;top: 6px;">-</span>
								<div class="clearfix" >
									<select class="form-control fix_padding" name="itemSelect" style="width: 100%" [attr.data]="item.phenomenon" (change)="selectedChange($event,'phenomenon',item)">
										<option value="">请选择</option>
										<option *ngFor="let _item of phenValueArr" [attr.value]="_item.type" > {{_item.text}} </option>
									</select>
								</div>
							</div>
							
							<div class="inline_block add_icon" style="">
								<div *ngIf="i<faultItemlist.length-1" (click)="item_del(i)" class="addOrDel">-</div>
								<div *ngIf="i==faultItemlist.length-1" (click)="item_add()" class="addOrDel">+</div>
							</div>
						</div>
					</div>
					<div class="" *ngIf="abnormalType === 'GPS'">
						<div>异常描述：</div>
						<select name="describe" class="form-control inline_block fix_padding" [(ngModel)]='describe'>
							<option value="">请选择</option>
							<option value="漂移">漂移</option>
							<option value="丢失">丢失</option>
						</select>
					</div>
					<div class="" *ngIf="abnormalType === '主机'">
						<div>异常描述：</div>
						<select name="describe" class="form-control inline_block fix_padding" [(ngModel)]='describe'>
							<option value="">请选择</option>
							<option value="离线">离线</option>
							<option value="丢包">丢包</option>
						</select>
					</div>
					<div class="" *ngIf="abnormalType === '线材'">
						<div>异常描述：</div>
						<select name="describe" class="form-control inline_block fix_padding" [(ngModel)]='describe'>
							<option value="">请选择</option>
							<option value="无通道数据">无通道数据</option>
							<option value="接触不良">接触不良</option>
						</select>
					</div>
				</div>
				<div *ngIf='sortType=="2"'>
					<div *ngIf="abnormalType">维修指导：</div>
					<select *ngIf="abnormalType === '传感器'" name="repairedGuide" class="form-control inline_block fix_padding" [(ngModel)]='repairedGuide'>
						<option value="">无</option>
						<option value="更换传感器">更换传感器</option>
					</select>
					<select *ngIf="abnormalType === 'GPS'" name="repairedGuide" class="form-control inline_block fix_padding" [(ngModel)]='repairedGuide'>
						<option value="">无</option>
						<option value="更换天线">更换天线</option>
						<option value="更换主机">更换主机</option>
					</select>
					<select *ngIf="abnormalType === '手刹'" name="repairedGuide" class="form-control inline_block fix_padding" [(ngModel)]='repairedGuide'>
						<option value="">无</option>
						<option value="更换手刹">更换手刹</option>
						<option value="更换主机">更换主机</option>
					</select>
					<select *ngIf="abnormalType === '主机'" name="repairedGuide" class="form-control inline_block fix_padding" [(ngModel)]='repairedGuide'>
						<option value="">无</option>
						<option value="检查是否有短路">检查是否有短路</option>
					</select>
					<select *ngIf="abnormalType === '线材'" name="repairedGuide" class="form-control inline_block fix_padding" [(ngModel)]='repairedGuide'>
						<option value="">无</option>
						<option value="更换线材">更换线材</option>
					</select>
					
					<div *ngIf='abnormalType'>
						<div>是否推送：</div>
						<select  name="isPush" class="form-control inline_block fix_padding" [(ngModel)]='isPush'>
							<option value="">请选择</option>
							<option value="1">推送</option>
							<option value="0">不推送</option>
						</select>
					</div>
				</div>
				
				<div> 
					<div>起始时间：</div>
					<!--<div *ngIf="sortType === '2'">故障时间：</div>-->
					<input type="text" name="startTime" class="form-control" [(ngModel)]='startTime' [ngClass]="{focusInp:getTimeInput == 'startTime'}"  (click)="getFocusInput('startTime')"/>
				</div>
				<div> 
					<div>结束时间：</div>
					<input type="text" name="endTime"   class="form-control" [(ngModel)]='endTime'   [ngClass]="{focusInp:getTimeInput == 'endTime'}"  (click)="getFocusInput('endTime')"/>
				</div>
			</div>
			<div class="bottomContent">
				<button type="button" class="btn btn-primary btn-sm"  (click)='submitRecord()'>问题提交</button>
				<button type="button" *ngIf="sortType === '2'" class="btn btn-primary btn-sm"  (click)='submitDevice()'>设备故障提交</button>
			</div>
		</div>
	</form>
</div>